#include <iostream>
using namespace std;
class MyClass
{
private:
    int secret = 42;

public:
    // friend 表示可以操作当前类的实例
    friend void revealSecret(const MyClass &obj)
    {
        std::cout << "Secret: " << obj.secret << std::endl;
    }
};

int main()
{
    MyClass m1;
    revealSecret(m1);
    return 0;
}